package link.anyauto.j2m.service;

import android.app.IntentService;
import android.content.Intent;
import android.util.Log;

/**
 * Created by Administrator on 2016/5/5.
 */
public class ShortTermService extends IntentService {

    public ShortTermService() {
        super("Short term service.");
        Log.e(TAG, "ShortTermService");
    }

    @Override
    public void onCreate() {
        super.onCreate();
        Log.e(TAG, "onCreate");
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.e(TAG, "onStartCommand id -> " + startId);
        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public void onStart(Intent intent, int startId) {
        super.onStart(intent, startId);
        Log.e(TAG, "onStart id -> " + startId);
    }

    @Override
    protected void onHandleIntent(Intent intent) {
        Log.e(TAG, "intent extra -> " + intent.getStringExtra(KEY_EXTRA));
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.e(TAG, "onDestroy");
    }

    String TAG = getClass().getName();
    public static final String SHORT_TERM_ACTION = "link.anyauto.j2m.SHORT_TERM_SERVICE";
    public static final String KEY_EXTRA = "extra";
}
